package org.nmgyjt.springboot.task;

import org.nmgyjt.springboot.entity.admin.CsSystemSourceExt;
import org.nmgyjt.springboot.entity.expert.ExpertInfo;
import org.nmgyjt.springboot.mapper.CsSystemSourceExtMapper;
import org.nmgyjt.springboot.service.*;
import org.nmgyjt.springboot.service.impl.CsSystemSourceExtServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SyncZwwx {
    @Autowired
    ICsSystemSourceExtService iCsSystemSourceExtService;
    @Autowired
    CsSystemSourceExtMapper csSystemSourceExtMapper;
    @Autowired
    RescueTeamService rescueTeamService;
    @Autowired
    StoreService storeService;
    @Autowired
    ProtectTargetService protectTargetService;
    @Autowired
    RefugeService refugeService;
    @Autowired
    ExpertService expertService;

    //同步负责人
//    @Scheduled(cron = "0 0 11 * * ?") // 每半小时
//    @Scheduled(fixedRate = 2700000) // 45
    public void doZWWXResources() {
        rescueTeamService.snycZwwxByHeadPhone();
        storeService.snycZwwxByHeadPhone();
        protectTargetService.snycZwwxByHeadPhone();
        refugeService.snycZwwxByHeadPhone();
    }

    //同步专家
//    @Scheduled(cron = "0 10 11 * * ?")  // 每半小时
//    @Scheduled(fixedRate = 2700000) // 45
    public void doZWWXExpertInfo() {
        expertService.snycZwwxByHeadPhone();
    }

    //同步管理员
//    @Scheduled(cron = "0 20 11 * * ?")  // 每半小时
//    @Scheduled(fixedRate = 2700000) // 45
    public void doZWWXAdmin() {
        iCsSystemSourceExtService.snycZwwxByHeadPhone();
    }
}
